<!--
 * @Author: ChunLai
 * @Date: 2023-08-24 10:12:14
 * @LastEditTime: 2025-11-25 09:19:40
 * @Description: 新功能组件测试
 * @FilePath: \01.latest-short-insure\src\views\test\index.vue
-->
<template>
  <div>
    <!-- <MsFieldInput v-model="value" label="体重" funit="kg" /> -->
    <InputSearch />
  </div>
</template>

<script>
import MsFieldInput from "./components/MsFieldInput";
import InputSearch from "./components/InputSearch";
// import msFuns from "./func";

export default {
  name: "NewCopmTest",
  data() {
    return {
      value: "",
    };
  },
  components: { MsFieldInput, InputSearch },
  computed: {},
  watch: {},
  created() {
    // this.fieldCheck();
  },
  mounted() {},
  methods: {
    fieldCheck() {
      const obj = {
        name: "",
        idType: "",
        idName: "",
        height: "60",
        idNum: "3333",
        sex: "2",
        birthDate: "",
        email: "",
        province: "",
      };
      let arr = Object.keys(obj),
        errArr = [],
        status = true;
      const len = arr.length;
      for (let i = 0; i < len; i++) {
        const item = arr[i],
          fucName = `${item}RuleCheck`;
        // console.log(i);
        if (msFuns[`${fucName}`]) {
          // console.log(item);
          const res = msFuns[`${fucName}`](obj[`${item}`]);
          if (res.msg) {
            if (res.status) {
              errArr = [...errArr, res.msg];
            } else {
              status = false;
              this.$toast(`${res.msg}`);
              break;
            }
          }
        }
      }
      if (status && errArr.length > 0) {
        this.$baseConfirm(
          errArr.join(";"),
          () => {},
          null,
          "继续投保",
          "修改信息"
        );
      }
    },
  },
};
</script>

<style lang="less" scoped></style>
